//
//  Extension+NSAttributedString.swift
//  TTWeibo
//
//  Created by 陶宏路 on 16/7/31.
//  Copyright © 2016年 陶路路. All rights reserved.
//

import UIKit

extension NSAttributedString{
    
    convenience init(model:TTEmoticonsModel,emotionHight:CGFloat?){
        
        let attr = TTTextAttachment()
        //            设置图片
    
        attr.emotionModel = model
        
        attr.image = UIImage.getImageWithBoundle(model.path)
        //            计算行高
        //            设置bounds
        attr.bounds = CGRectMake(0, -4, emotionHight!, emotionHight!)
        //            不可变富文
        self.init(attachment:attr)
    }
}
